#!/bin/bash
# mysql is alive or dead

host="127.0.0.1"
user="root"
passwd="123456"
dbname="mysql"
date=$(date +%Y-%m-%d)

[ ! -d /mysqlbackup ] && mkdir /mysqlbackup

mysqldump -u$user -p$passwd -h$host -A > /mysqlbackup/"dbname"-${date}.sql
